<?php
class XLog4YaxFileAppender extends XLog4YaxAbstractAppender{
	protected $file = 'log4yax';
	
	public function __construct($name, $params = array()){
		parent::__construct($name, $params);
		$this->file = $this->getFile($params);
		$this->file->create();
	}
	
	protected function output($message){
		$appender = new XFileAppender($this->file);
		$appender->append($message);
		$appender->close();
	}
	
	/**
	 * @return XFile
	 */	
	protected function getFile($params = array()){
		if(isset($params['file'])){
			$this->file = $params['file'];
		}
		$this->file = PROJECT_ROOT.DIRECTORY_SEPARATOR.'logs'.DIRECTORY_SEPARATOR.$this->file.'.log';
		return new XFile($this->file);	
	}
}
?>